package io.kiki.sba.registry.common.model.slot;

import lombok.Getter;

import java.io.Serializable;


public class BaseSlotStatus implements Serializable {

    @Getter
    protected final int slotId;

    @Getter
    protected final long slotLeaderEpoch;
    @Getter
    protected final SlotRole slotRole;

    @Getter
    protected final String server;


    public BaseSlotStatus(int slotId, long slotLeaderEpoch, SlotRole slotRole, String server) {
        this.slotId = slotId;
        this.slotLeaderEpoch = slotLeaderEpoch;
        this.slotRole = slotRole;
        this.server = server;
    }


    public enum LeaderStatus {
        init, healthy, unhealthy;// init, healthy, unhealthy;

        public boolean isHealthy() {
            return this == healthy;
        }
    }
}
